home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_bab_gatecam.cog < prev    next >
Text File  |  1999-11-15  |  6KB  |  202 lines

  1. # Jones 3D Cog Script
  2. #
  3. # bab_GateOpen.cog
  4. #
  5. # This cog will take the camera to a frame in front of the shark gate,watch
  6. # it move then jump back to the player.
  7. #
  8. # [CM]
  9. #
  10. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.     message     startup
  16.     message     activate
  17.  
  18.     thing        gate0                
  19.     thing        gate1
  20.     thing       gatecam
  21.     thing       indycam
  22.     thing       player0                                 local
  23.     thing       actorindy                               
  24.     thing       lever                                   linkid=1
  25.                                                         
  26.     keyframe    in_pull=in_pull_lever_down.key            local
  27.     keyframe    lever_down=gen_lever.key                local
  28.     
  29.     sound       gatesqueal=fol_in_scrapemetal_med.wav   local
  30.     sound       leverpull=nub_lever_pull_c.wav          local
  31.     sound       leverback=nub_lever_reset_c.wav         local
  32.     sound       gatestop=tem_ldoorr_ldoorl_close_c.wav  local
  33.             
  34.     flex        movespeed=1.0
  35.     flex        flag = 0                                local
  36.     int         hitit=0                                 local
  37.     int         gatechannel                             local
  38.     flex        opengate                                local
  39.     flex        closegate                               local
  40.     int         wepnum=1                                local
  41.     int         lastrand=-1                             local
  42.     int         currand=0                               local
  43.                                                         
  44.     sound       indylineb0=inxj058.wav                  local
  45.     sound       indylineb1=inxj059.wav                  local
  46.     sound       indylineb2=inxj060.wav                  local
  47.     sound       indylineb3=inxj061.wav                  local
  48.     sound       indylineb4=inxj090.wav                  local
  49.     sound       indylineb5=inxj095.wav                  local
  50.     
  51. end
  52.  
  53. # ========================================================================================
  54.  
  55. code
  56. startup:
  57.  
  58.     player0 = GetLocalPlayerThing();
  59.     
  60. return;                                   
  61.     
  62. #........................................................................................
  63.  
  64. activate:
  65.                        
  66.     if ((GetSenderRef() == lever) && (GetCurFrame(gate0) == 0) && (hitit == 0) && (GetCurItem(player0) == 0))
  67.     {
  68.         hitit = 1;
  69.         While(wepnum !=0)
  70.         {
  71.             wepnum = GetCurWeapon(player0);
  72.             DeselectWeaponWait(player0);
  73.             DeselectWeapon(player0);
  74.             //printint(wepnum);
  75.         }
  76.         call opengate;        
  77.     }
  78.     
  79.     else if ((GetSenderRef() == lever) && (GetCurFrame(gate0) == 1) && (hitit == 0) && (GetCurItem(player0) == 0))
  80.     {
  81.         hitit = 1;
  82.         While(wepnum !=0)
  83.         {
  84.             wepnum = GetCurWeapon(player0);
  85.             DeselectWeaponWait(player0);
  86.             DeselectWeapon(player0);
  87.             //printint(wepnum);
  88.         }
  89.         call closegate;
  90.     }
  91.     
  92.     if ((GetCurItem(player0) != 0) && (GetSenderID() == 1))
  93.     {
  94.         StopThing(player0);
  95.         StartCutscene(1);
  96.         SetActorFlags(player0, 0x200000);
  97.         currand = RandBetween(0, 5);
  98.         While (lastrand == currand)
  99.         {
  100.             currand = RandBetween(0, 5);
  101.         }
  102.         PlayVoice(player0, indylineb0[currand], 1, 1);
  103.         lastrand = currand;
  104.         EndCutscene();
  105.         ClearActorFlags(player0, 0x200000);
  106.     }
  107.             
  108. return;
  109.     
  110. #........................................................................................
  111.  
  112. opengate:
  113.  
  114.     SetActorFlags(player0, 0x200000);
  115.     StartCutScene(1);
  116.     SetThingFlags(player0, 0x80000);
  117.     SetCameraFocus(0, indycam);
  118.     SetCurrentCamera(0);
  119.     SetCameraFOV(90, 0, 0.0);
  120.     CopyPlayerHolsters(player0, actorindy);
  121.     ClearThingFlags(actorindy, 0x80000);
  122.     PlayKey(lever, lever_down, 4, 0x12, 0);
  123.     PlayKey(actorindy, in_pull, 4, 0x12, 0);
  124.     Sleep(0.85);
  125.     PlaySoundThing(leverpull, lever, 1, 5, 10, 0);
  126.     Sleep(1.5);
  127.     SetCameraFOV(90, 0, 0.0);
  128.     SetCameraFocus(0, gatecam);
  129.     SetCollideType(gate0, 0);
  130.     SetCollideType(gate1, 0);
  131.     Sleep(0.01);
  132.     SetCameraFOV(75, 1, 2.0);
  133.     MoveToFrame(gate0, 1, movespeed);
  134.     gatechannel = PlaySoundThing(gatesqueal, gate0, 1, 10, 20, 1);
  135.     MoveToFrame(gate1, 1, movespeed);
  136.     WaitForStop(gate1);
  137.     StopSound(gatechannel, 0);
  138.     PlaySoundThing(gatestop, gate0, 1, 10, 20, 0);
  139.     SetCollideType(gate0, 3);
  140.     SetCollideType(gate0, 3);
  141.     Sleep(1.0);
  142.     SetThingFlags(actorindy, 0x80000);
  143.     SetCameraFocus(1, player0);
  144.     SetCurrentCamera(1);
  145.     ResetCameraFOV(0, 0.0);
  146.     ClearThingFlags(player0, 0x80000);
  147.     EndCutScene();
  148.     ClearActorFlags(player0, 0x200000);
  149.     hitit = 0;  
  150.     wepnum = 1;
  151.     
  152. return;
  153.  
  154. #........................................................................................
  155.  
  156. closegate:
  157.  
  158.     SetActorFlags(player0, 0x200000);
  159.     StartCutScene(1);
  160.     SetThingFlags(player0, 0x80000);
  161.     SetCameraFocus(0, indycam);
  162.     SetCameraFOV(90, 0, 0.0);
  163.     SetCurrentCamera(0);
  164.     SetCameraFOV(90, 0, 0.0);
  165.     ClearThingFlags(actorindy, 0x80000);
  166.     PlayKey(lever, lever_down, 4, 0x12, 0);
  167.     PlayKey(actorindy, in_pull, 4, 0x12, 0);
  168.     Sleep(0.7);
  169.     PlaySoundThing(leverpull, lever, 1, 5, 10, 0);
  170.     Sleep(1.5);
  171.     SetCameraFOV(90, 0, 0.0);
  172.     SetCameraFocus(0, gatecam);
  173.     SetCurrentCamera(0);
  174.     SetCollideType(gate0, 0);
  175.     SetCollideType(gate1, 0);
  176.     MoveToFrame(gate0, 0, movespeed);
  177.     gatechannel = PlaySoundThing(gatesqueal, gate0, 1, 10, 20, 1);
  178.     MoveToFrame(gate1, 0, movespeed);
  179.     WaitForStop(gate1);
  180.     StopSound(gatechannel, 0);
  181.     PlaySoundThing(gatestop, gate0, 1, 10, 20, 0);
  182.     SetCollideType(gate0, 3);
  183.     SetCollideType(gate1, 3);
  184.     Sleep(1.0);
  185.     SetThingFlags(actorindy, 0x80000);
  186.     SetCameraFocus(1, player0);
  187.     SetCurrentCamera(1);
  188.     ResetCameraFOV(0, 0.0);
  189.     ClearThingFlags(player0, 0x80000);
  190.     EndCutScene();
  191.     ClearActorFlags(player0, 0x200000);
  192.     hitit = 0;
  193.     wepnum = 1;
  194.     
  195. return;    
  196.     
  197. #........................................................................................
  198.                     
  199. end
  200.  
  201.  
  202.